<?php

namespace App\Models;

use App\Models\ZZMed\ZUser;
use Illuminate\Database\Eloquent\Model;

class ZPituitaryHospitalCustomSmsTemplate extends Model {

    protected $table = 'z_pituitary_hospital_custom_sms_template';

    protected $guarded = ['id'];
    
    
    public static function getSmsTemplates($hospId,$deptId)
    {
        return self::query()->where('hosp_id', $hospId)->where('dept_id', $deptId)->where('is_deleted' ,0)->get()->toArray();
    }

    public static function getNoticeTemplate($types)
    {
        return ZUser::query()
            ->from('sms_template_config')
            ->select('type', 'name',  'content')
            ->whereIn('type', $types)
            ->get()
            ->toArray();
    }

}
